<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBrandAndGoodCategoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('brand_goods_category', function(Blueprint $blueprint) {
            $blueprint->integer('brand_id')->unsigned()->comment('品牌表 ID');
            $blueprint->integer('goods_category_id')->unsigned()->comment('商品分类表 ID');

            $blueprint->primary(['brand_id', 'goods_category_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('brand_goods_category');
    }
}
